<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>+号在js中的含义</title>
    <script>
        //1.算术加法
        // console.log(10+20); //30
        // let num1 = 100;
        // let num2 = 200;
        // console.log(num1+num2); //300

        //2.字符串拼接. 
        //+号两边如果有一边或者两边都是字符串. 那就会拼接成一个新的字符串.
        // console.log(10+'20'); // '1020'
        // console.log('true' + false); //'truefalse'
        // console.log(11.2 + '哈哈'); //'11.2哈哈'


        // let age = 18;
        // console.log('我的年龄是'+age);

        // let name = '林帅哥';
        // let age = 18;
        // console.log('我的名字是name,我的年龄是age岁');
        // console.log('我的名字是'+name+',我的年龄是'+age+'岁');

        //--------------------------------------------------------------------
        //思考题
        // console.log(10+20+30); //60
        // console.log('10'+20+30); //'102030'
        // console.log(10+'20'+30); //'102030'
        // console.log(10+20+'30'); //'3030'


      

    </script>
</head>

<body>

</body>

</html>